home *** CD-ROM | disk | FTP | other *** search
- Path: seas.gwu.edu!ckann
- From: ckann@seas.gwu.edu (Charles W. Kann)
- Newsgroups: comp.lang.c++,comp.lang.java
- Subject: Re: Java: What's the Big Deal?
- Followup-To: comp.lang.c++,comp.lang.java
- Date: 3 Apr 1996 16:27:48 GMT
- Organization: George Washington University
- Message-ID: <4ju8u4$h4u@cronkite.seas.gwu.edu>
- References: <milodDoF9JF.K32@netcom.com> <1996Mar20.154600.12011@amc.com> <3160AB73.6653@www.nwho.com>
- NNTP-Posting-Host: 128.164.9.3
- X-Newsreader: TIN [version 1.2 PL2]
-
- Jan & Gord Wait (nwho@www.nwho.com) wrote:
- : Pohl Longsine wrote:
- : >
- : > In <milodDoL1uy.581@netcom.com> John DiCamillo wrote:
- : > > curtis@amc.com (Curtis Green) writes:
- : > > >John DiCamillo (milod@netcom.com) wrote:
- : > > >: pete@borland.com (Pete Becker) writes:
- : > >
- : > > >: >There's no reason you can't write a C++ compiler that generates a Java
- : > > >: >bytestream.
- : > >
- : > > >: Are you claiming that arbitrary, correct (ANSI) C++ code can
- : > > >: be compiled to the JVM and continue to work correctly?
- : >
- : > Since Java is based upon a VM with an "instruction set" one could write a
- : > compiler for any language, the output for which is the "object code" of the
- : > VM. (Unless there's some design flaw in the VM architecture that I'm
- : > unaware of.)
- : >
- : > Any compiler gurus out there that can explain why I might be wrong here?
- : > --
- : > pohl@screaming.org
- : > http://mmm.screaming.org/
-
- : It might not be impossible, but it wouldn't be trivial: C and C++ support
- : direct address pointers, that usually end up as address references in machine
- : language (which is why C and C++ can be fast). Java won't let you get at
- : address pointers, so you would have to build a fake higher level memory system
- : in java VM to support the pointers from the C ish source code.. ugghhh..
-
- And the nature of strings and arrays would be a problem. But to my mind
- the biggest problem is that C and C++ are not based completly on an object
- model. Free standing subroutines go somewhere, but where? What if you have
- a library of subroutines, does each go into it's own class, or do you
- create an class based on the file they are in?
-
- This has been my biggest problem using Ada with Java. What exactly is an
- object in Ada? It is something different than it is in Java. And the
- modularity of the program is different. I know that the argument is that
- the compiler should translate to something Java understands, and that I
- should not worry what that is. But to my mind understanding a Java program
- means understanding how the Java machine is working on the problem. I
- want to know what the classes are. And what if another compiler chooses a
- different naming convention (as in C++ name mangling, which is a problem
- in using different C++ compilers today, and why object code is not portable).
- I just am not comfortable with the "compiler should completely hide the
- abstraction" concept, for Java anyway. A class is just too central a concept.
-
- The bottom line is, I think that if you are going to run on a Java VM,
- you need to understand something about how your program looks to the VM.
- This is not completely straight forward even for a language which is closer
- to Java (such as Ada) than one with an entirely different philosophy
- (such as C). I think C and C++ compilers would be pretty difficult to use
- with Java.
-
- --
- chuck kann
- ckann@seas.gwu.edu
-